//package com.zmn.plat.admin.controller.category.attributeenum;
//
//import java.util.List;
//
//import org.apache.shiro.authz.annotation.RequiresPermissions;
//import org.springframework.stereotype.Controller;
//import org.springframework.web.bind.annotation.ModelAttribute;
//import org.springframework.web.bind.annotation.RequestMapping;
//import org.springframework.web.bind.annotation.RequestParam;
//import org.springframework.web.servlet.ModelAndView;
//
//import com.zmn.common.dictionary.GlobalDict;
//import com.zmn.plat.admin.controller.category.CategoryBaseController;
//import com.zmn.plat.model.entity.category.BaseCategory;
//import com.zmn.plat.model.entity.category.BaseCategoryAttribute;
//import com.zmn.plat.model.entity.category.BaseCategoryAttributeEnum;
//import com.zmn.plat.model.entity.category.BaseCategoryAttributeEnumQuery;
//
///**
// * @author duanzuocai
// * @version v1.0
// * @since 2018/10/20 9:15
// */
//@Controller
//@RequestMapping("/categ/attrenum/")
//public class CategoryAttributeEnumListController extends CategoryBaseController {
//
//    @RequiresPermissions("/categ/attrenum/list.action")
//    @RequestMapping(value = "list")
//    public ModelAndView list(@ModelAttribute BaseCategoryAttributeEnumQuery query) {
//        ModelAndView mav = new ModelAndView("attributeenum/list");
//
//        Integer attrId = query.getAttrId();
//        if (attrId == null) {
//            return mav;
//        }
//
//        List<BaseCategoryAttributeEnum> items = baseCategoryAttributeEnumService.listPageByQuery(query);
//        BaseCategoryAttribute attr = baseCategoryAttributeService.findByKey(attrId);
//        BaseCategory categ = baseCategoryService.findByKey(attr.getCategId());
//        BaseCategory parent = baseCategoryService.findByKey(categ.getParentId());
//
//        mav.addObject("categ", categ);
//        mav.addObject("parent", parent);
//        mav.addObject("vo", query);
//        mav.addObject("attr", attr);
//        mav.addObject("items", items);
//        return mav;
//    }
//
//    @RequiresPermissions("/categ/attrenum/detail.action")
//    @RequestMapping(value = "detail")
//    public ModelAndView detail(@RequestParam(value = "enumId", defaultValue = "0") Integer enumId,
//        @RequestParam(value = "attrId", defaultValue = "0") Integer attrId) {
//
//        BaseCategoryAttributeEnum attrenum;
//
//        if (enumId < 1) {
//            attrenum = new BaseCategoryAttributeEnum();
//        } else {
//            attrenum = baseCategoryAttributeEnumService.findByKey(enumId);
//            attrId = attrenum.getAttrId();
//        }
//
//        ModelAndView mav = new ModelAndView("attributeenum/detail");
//
//        BaseCategoryAttribute attr = baseCategoryAttributeService.findByKey(attrId);
//
//        mav.addObject("attr", attr);
//        mav.addObject("attrenum", attrenum);
//        mav.addObject("statuses", GlobalDict.getStatusList(false));
//        return mav;
//    }
//}
